package com.fourhats.services.impl;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.transaction.annotation.Transactional;

import com.fourhats.dao.UserDAO;

//@Service
//@Transactional(readOnly=true)
public class CustomUserDetailsService implements UserDetailsService{

	@Autowired  
	private UserDAO userDAO;
	
	@Override
	@Transactional
	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException {
		com.fourhats.model.User user = userDAO.getUser(username);
//		return new org.springframework.security.core.userdetails.User(
//				user.getUsername(), 
//				user.getPassword(), 
//				new ArrayList<GrantedAuthority>()); 
		return null;
	}
	
}
